import './assets/main.css'
import 'element-plus/dist/index.css';    // 引入样式
import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import { createPinia } from 'pinia'
import router from './router'

// 引入 Markdown 编辑器和预览组件
import VMdEditor from '@kangc/v-md-editor'
import VMdPreview from '@kangc/v-md-editor/lib/preview'
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js'
import '@kangc/v-md-editor/lib/style/base-editor.css'
import '@kangc/v-md-editor/lib/style/preview.css'
import '@kangc/v-md-editor/lib/theme/style/vuepress.css'
import Prism from 'prismjs'

const app = createApp(App)
app.use(ElementPlus)
app.use(createPinia())
app.use(router)

// 全局注册编辑器和预览组件
app.use(VMdEditor)
app.use(VMdPreview)

// 配置主题和 Prism
VMdEditor.use(vuepressTheme, { Prism })
VMdPreview.use(vuepressTheme, { Prism })

app.mount('#app')